package com.tdam2011.grupo02.messagesender;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import com.tdam2011.grupo02.ui.SendMessageErrorActivity;

public class SendMessageErrorReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		Intent errorDialog = new Intent(context, SendMessageErrorActivity.class);
		if (intent.hasExtra("error"))
			errorDialog
					.putExtra("error", intent.getExtras().getString("error"));
		if (intent.hasExtra("destinatario"))
			errorDialog.putExtra("destinatario",
					intent.getExtras().getString("destinatario"));
		if (intent.hasExtra("mensaje"))
			errorDialog.putExtra("mensaje",
					intent.getExtras().getString("mensaje"));
		errorDialog.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(errorDialog);
	}
}
